<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/templates/plantillaPrincipal.xhtml">
	<ui:define name="content">
		<div class="audioBckg">
			<f:view>

				<p:tree value="#{audioBean.root}" var="node" selectionMode="single"
					selection="#{audioBean.selectedNode}" id="treeCategorias">
					<p:ajax event="select" listener="#{audioBean.onNodeSelect}" />
					<p:ajax event="unselect" listener="#{audioBean.onNodeUnselect}" />
					<p:treeNode expandedIcon="ui-icon-folder-open"
						collapsedIcon="ui-icon-folder-collapsed">
						<h:outputText value="#{node.nombre}" />
					</p:treeNode>
				</p:tree>
				<br/>
				<p:panel style="width:308px">
					<h:form>
						<h:panelGrid columns="3" border="0" cellspacing="6">
							<h:outputText value="#{msg.usuario} " styleClass="ui-widget"/>
							<h:inputText readonly="true" disabled="true"
								value="#{audioBean.archivo.usuario.email }" />
							<h:outputText value="" />
							<h:outputText value="#{msg.servidor} " styleClass="ui-widget"/>
							<h:inputText readonly="true" disabled="true"
								value="#{audioBean.archivo.servidor.nombre}" />
							<h:outputText value="" />
							<h:outputText value="#{msg.nombre} " styleClass="ui-widget"/>
							<h:inputText readonly="true" disabled="true"
								value="#{audioBean.archivo.nombreOriginal }" />
							<h:outputText value="" />
							<h:outputText value="#{msg.titulo} " styleClass="ui-widget"/>
							<h:inputText value="#{audioBean.archivo.titulo }" maxlenght="255" />
							<h:outputText value="" />
							<h:outputText value="#{msg.descripcion} " styleClass="ui-widget"/>
							<h:inputText value="#{audioBean.archivo.descripcion }"
								maxlenght="255" />
							<h:outputText value="" />
							<h:outputText value="#{msg.artista} " styleClass="ui-widget"/>
							<h:inputText value="#{audioBean.audio.artista }" maxlenght="255" />
							<h:outputText value="" />
							<h:outputText value="#{msg.album} " styleClass="ui-widget"/>
							<h:inputText value="#{audioBean.audio.album }" maxlenght="255" />
							<h:outputText value="" />
							<h:outputText value="#{msg.anyo} " styleClass="ui-widget"/>
							<p:spinner id="anyo" value="#{audioBean.audio.anyo}" max="2100"
								min="0" required="false" />
							<h:outputText value="" />
							<h:outputText value="#{msg.genero}" styleClass="ui-widget"/>
							<h:selectOneMenu value="#{audioBean.audio.genero}">
								<f:selectItems value="#{audioBean.listaComboGenero}" />
							</h:selectOneMenu>
							<h:outputText value="" />
						</h:panelGrid>
						<br />
						<h:panelGrid columns="4" cellspacing="2" border="0">
							<h:commandButton type="submit" action="irInicio"
								value="#{msg.inicio}" />
							<h:commandButton type="submit"
								action="#{audioBean.modificarAudio}" value="#{msg.modificar}"
								onclick="return confirm('#{msg.confirmarModificar}')"
								rendered="#{audioBean.propietario}" />
							<h:commandButton type="submit"
								action="#{audioBean.eliminarAudio}" value="#{msg.eliminar}"
								onclick="return confirm('#{msg.confirmarEliminar}')"
								rendered="#{audioBean.propietario}" />
							<h:commandButton type="submit"
								action="#{audioBean.descargarAudio}" value="#{msg.descargar}" />
						</h:panelGrid>
					</h:form>
				</p:panel>
			</f:view>
		</div>
	</ui:define>
</ui:composition>
</html>
